package kz.simplex.photobox.action;

import kz.simplex.photobox.model.*;
import org.jboss.seam.annotations.Name;
import org.jboss.seam.framework.EntityQuery;
import java.util.Arrays;

@Name("statusList")
public class StatusList extends EntityQuery<Status> {

	private static final String EJBQL = "select status from Status status";

	private static final String[] RESTRICTIONS = {
			"lower(status.dsc) like lower(concat(#{statusList.status.dsc},'%'))",
			"lower(status.status) like lower(concat(#{statusList.status.status},'%'))",};

	private Status status = new Status();

	public StatusList() {
		setEjbql(EJBQL);
		setRestrictionExpressionStrings(Arrays.asList(RESTRICTIONS));
		setMaxResults(25);
	}

	public Status getStatus() {
		return status;
	}
}
